<?php
/**
 * @Author: liuhongbin
 * @Email: 514660094@qq.com
 * @Date: 2019-02-12 16:15:10
 * @Description:
 * @LastEditors: liuhongbin
 * @LastEditTime: xxx
 */

namespace app\common\model\wechat;


use app\common\model\AdminBaseModel;
use app\common\model\wechat\tralts\WechatModel;

class WechatTransfer extends AdminBaseModel
{
    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'wechat_transfer';

    /**
     * 字段类型或者格式转换
     * @var array
     */
    protected $type = [

    ];
    use WechatModel;

    public function getTodayCount($openid)
    {
        $start = strtotime(date('Y-m-d'));
        $end = strtotime(date('Y-m-d', strtotime('+1 day')));
        return $this->where(['openid' => $openid])->whereBetween('create_time', $start . "," . $end)->count();
    }
}
